﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
    System.Data.DataTable kd = ViewBag.kd;
    System.Data.DataTable dw = ViewBag.dw;
    System.Data.DataTable kwzz = ViewBag.kwzz;
}
<style>
    .op {
        width: 25%;
        float: left;
    }
</style>

<H1>濮阳县教育考试工作证打印</H1>
<div>
    <div class="op">
        <span>考点：</span>
        <select id="selectKd">
            <option>
                未选择
            </option>
            @for (int i = 0; i < kd.Rows.Count; i++)
            {
                <option>
                    @kd.Rows[i]["dwmc"]
                </option>
            }
        </select>
    </div>
    <div class="op">
        <span>单位：</span>
        <select id="selectDw">
            <option>
                未选择
            </option>
            @for (int i = 0; i < dw.Rows.Count; i++)
            {
                <option>
                    @dw.Rows[i]["dwmc"]
                </option>
            }
       

        </select>
    </div>
    <div class="op">
        <span>考务职责：</span>
        <select id="selectKwzz">
            <option>
                未选择
            </option>
             @for (int i = 0; i < kwzz.Rows.Count; i++)
            {
                <option>
                    @kwzz.Rows[i]["kwzz"]
                </option>
            }
      

        </select>
    </div>
    <div class="op"><input type="button" value="打 印" onclick="print()"></input></div>
</div>
<div>
    <span>姓名：</span>
    <input id="name" type="text" style="width:900px"  />
</div>

<script>
function print() { 
    var kd = document.getElementById("selectKd").value;
    var dw = document.getElementById("selectDw").value;
    var kwzz = document.getElementById("selectKwzz").value;
    var name = document.getElementById("name").value;
    if (dw != '未选择' && kwzz != '未选择') {
        window.open("http://218.29.194.27:5701/jky/page?gzdw=" + dw + "&kwzz=" + kwzz);      
  }




    if (name != "") { 
    
           window.open("http://218.29.194.27:5701/jky/page?xm="+name) 
    }

    else if (kd != '未选择') {

           window.open("http://218.29.194.27:5701/jky/page?kd="+kd) 
    }else if (dw != '未选择') {
       // alert("暂时不支持此功能");
          window.open("http://218.29.194.27:5701/jky/page?gzdw="+dw) 
    } else if (kwzz != '未选择') {
       window.open("http://218.29.194.27:5701/jky/page?kwzz="+kwzz) 
    }
}
</script>